#!/bin/bash
# 将数据从hive转存到mysql中
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE-$0}")"; pwd)
source ${CUR_DIR}/system_env.sh
hiveTable=$1
hivePartitionValues=$2
hivePartitionKeys=day

hiveSql="load data inpath '${hive_warehouse_base_path}/${hive_db_path}${hiveTable}/${hivePartitionKeys}=${hivePartitionValues}'  INTO TABLE ${hive_db}.${hiveTable} PARTITION(${hivePartitionKeys}='${hivePartitionValues}')"

echo ${hiveSql}
hive -e "${hiveSql}"